package top.jiangqiang.qyblog.core.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import top.jiangqiang.qyblog.core.base.entity.BaseEntity;

import java.io.Serial;

/**
 * <p>
 * 上传的文件
 * </p>
 *
 * @author JiangQiang
 * @since 2023-07-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("qy_file")
@Schema(name = "File", description = "$!{table.comment}")
public class File extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "文件全局唯一key")
    private String fileKey;

    @Schema(description = "文件访问地址")
    private String url;

    @Schema(description = "文件名，包括后缀")
    private String name;

    @Schema(description = "文件大小")
    private Long size;

    @Schema(description = "存储器配置id")
    private Long storageId;

    @Schema(description = "文件MIME类型")
    private String type;

    @Schema(description = "上传状态，1正常，2上传中，3上传失败")
    private Integer state;
}
